package com.qingcheng.controller.order;

import com.alibaba.dubbo.config.annotation.Reference;
import com.qingcheng.service.order.CategoryReportService;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @Author: LDeng
 * @Date: 2020-04-16 16:27
 */
@Component
public class OrderTask {

//    @Scheduled(cron="* * * * * ?")//方法的时间规则 cron 表达式
//    public void orderTimeOutLogic(){
//        System.out.println(new Date());
//    }

    @Reference
    private CategoryReportService categoryReportService;

    @Scheduled(cron="* * * 1 * ? ")
    public void createCategoryReportDate(){
        System.out.println("=========================>生成类目统计数据");
        categoryReportService.createDate();
    }

}
